<template>
	<view :class="type === 1? 'userComAll' : 'HBComAll'">
		<view v-if="!isWarn" class="warn" @click.stop="resend">
			<image :src="warnIcon" mode="aspectFit"/>
		</view>
		<image :src="imagePath" class="mainImg" mode="widthFix"></image>
	</view>
</template>

<script>
	export default {
		props:{
			imagePath:String,
			type:Number,
			isWarn: Boolean,
			indexID:Number,
		},
		data() {
			return {
				warnIcon:require('@/static/icon/wran.png')
			}
		},
		methods:{
			resend(){
				if(!this.isWarn) {
					this.$emit('reSend', this.indexID)
				}
			}
		}
	}
</script>

<style scoped>
	.userComAll{
		border-radius: 15upx;
		width:100%;
		display: flex;
		justify-content: flex-end;
		margin: 20upx 0;
	}
	.userComAll .mainImg{
		border-radius: 15upx;
		max-width: 60%;
	}
	.HBComAll{
		border-radius: 15upx;
		width:100%;
		display: flex;
		justify-content: flex-start;
		margin: 20upx 0;
	}
	.HBComAll .mainImg{
		border-radius: 15upx;
		max-width: 60%;
	}
	.userComAll .warn{
		display: flex;
		margin-right: 20upx;
	}
	.HBComAll .warn{
		display: flex;
		margin-left: 20upx;
	}
	.warn image{
		width:40upx !important;
		height:40upx !important;
		margin: auto 0;
	}
</style>
